﻿
using System;
namespace LeMigue.Scrum.Iterface.Model
{
    /// <summary>
    /// Base para todos os itens do scrum
    /// </summary>
    [Serializable]
    public class ScrumItem : IItem
    {
        private int _id = 0;
        private string _title = null;
        private string _description = null;
        
        /// <summary>
        /// Contrutor de um item novo
        /// </summary>
        public ScrumItem(){}

        /// <summary>
        /// Contrutor de um item existente
        /// </summary>
        /// <param name="id">Id do item</param>
        /// <param name="title">Titulo do item</param>
        protected ScrumItem(int id, string title)
        {
            _id = id;
            _title = title;
        }

        /// <summary>
        /// Id do item
        /// </summary>
        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        /// <summary>
        /// Titulo do item
        /// </summary>
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        /// <summary>
        /// Descrição do item
        /// </summary>
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        public override bool Equals(object obj)
        {

            return this.Id == ((ScrumItem)obj).Id;
        }

        public Team Team { get; set; }
    }
}
